package com.itheima04;

public class AddableDemo {
    public static void main(String[] args) {

        Addable a = new Addablelmpl();
        useAddable(a);

        useAddable(new Addable() {
            @Override
            public int add(int x, int y) {
                return x + y;
            }
        });

        useAddable((int x, int y) -> {
            return x + y;
        });


    }

    private static void useAddable(Addable a) {
        int add = a.add(10, 20);
        System.out.println("总和：" + add);
    }
}
